//
//  BaseResponse.swift
//  Kosspot
//
//  Created by 胡辉 on 2025/7/22.
//

import Foundation

protocol BaseResponseProtocol: Decodable {
    var code: Int { get }
    var msg: String { get }
}

struct BaseResponse<DataType: Decodable>: BaseResponseProtocol {
    let code: Int
    let msg: String
    let data: DataType?
    

    
    enum CodingKeys: String, CodingKey {
        case code, msg, data
    }
}

struct SimpleResponse: BaseResponseProtocol {
    let code: Int
    let msg: String
    
    
    enum CodingKeys: String, CodingKey {
        case code, msg
    }
}
